package net.aiform.entity.security;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import net.aiform.entity.IdEntity;

/**
 * Module entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "module")
public class Module  extends IdEntity {

	// Fields

	private Module module;
	private String moduleName;
	private String moduleRemark;
	private String moduleUrl;
	private Integer moduleStep;
	private Integer moduleSequence;
	private Set<Authority> authorities = new HashSet<Authority>(0);
	private Set<Module> modules = new HashSet<Module>(0);

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MOD_ID")
	public Module getModule() {
		return this.module;
	}

	public void setModule(Module module) {
		this.module = module;
	}

	@Column(name = "MODULE_NAME", length = 150)
	public String getModuleName() {
		return this.moduleName;
	}

	public void setModuleName(String moduleName) {
		this.moduleName = moduleName;
	}

	@Column(name = "MODULE_REMARK", length = 256)
	public String getModuleRemark() {
		return this.moduleRemark;
	}

	public void setModuleRemark(String moduleRemark) {
		this.moduleRemark = moduleRemark;
	}

	@Column(name = "MODULE_URL", length = 500)
	public String getModuleUrl() {
		return this.moduleUrl;
	}

	public void setModuleUrl(String moduleUrl) {
		this.moduleUrl = moduleUrl;
	}

	@Column(name = "MODULE_STEP")
	public Integer getModuleStep() {
		return this.moduleStep;
	}

	public void setModuleStep(Integer moduleStep) {
		this.moduleStep = moduleStep;
	}

	@Column(name = "MODULE_SEQUENCE")
	public Integer getModuleSequence() {
		return this.moduleSequence;
	}

	public void setModuleSequence(Integer moduleSequence) {
		this.moduleSequence = moduleSequence;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "module")
	public Set<Authority> getAuthorities() {
		return this.authorities;
	}

	public void setAuthorities(Set<Authority> authorities) {
		this.authorities = authorities;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "module")
	public Set<Module> getModules() {
		return this.modules;
	}

	public void setModules(Set<Module> modules) {
		this.modules = modules;
	}

}